import processing.serial.*;

Serial port;
PFont myFont;

String inString="";

/**
 * setup()
 */
void setup(){
  myFont = createFont("SansSerif", 32);
  println(Serial.list());
  size ( 640, 200);

  // Assuming that 3rd serial port is connected to Arduino
  port = new Serial(this, Serial.list()[3], 9600);

  // Data will be available when NL(LF) receive.
  // LF文字受信でシリアルイベントが通知される
  port.bufferUntil(10);

}

/**
 * draw()
 */
void draw(){
  background(0);
  smooth();
  fill(255,0,0);
  
  textFont(myFont);
  text (inString , 20, 70);

}

/**
 * serialEvent()
 */
void serialEvent(Serial p) {

  inString = (port.readString());
/*
  String hhmm = String.format("%02d", hour()) + ":" 
  + String.format("%02d", minute());
  println(s[0] + " / " + hhmm);
*/


}


